package com.getjsp.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;


public class CheckNet {
	public static boolean checkNet(Context context){
		
		try{
			ConnectivityManager connectivity = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
			if(connectivity != null){
				
				NetworkInfo info = connectivity.getActiveNetworkInfo();
				if(info != null && info.isConnected()){
					
					if(info.getState() == NetworkInfo.State.CONNECTED);
					return true;
				}
			}
		}catch (Exception e){}
		return false;
	}
}
